package cn.gorit.common.enums;

/**
 * @Classname ResultEnums
 * @Description 结果返回枚举类
 * @Date 2021/1/19 23:09
 * @Created by CodingGorit
 * @Version 1.0
 */
public enum ResultEnums {
    // 通用结果返回枚举
    SUCCESS(20000,"操作成功"),
    CREATED(20001,"资源创建成功"), // 添加数据返回的数据
    UPLOAD_SUCCESS(20002,"上传资源成功"),
    DELETE_SUCCESS(20003,"删除成功"),
    FREEZE_SUCCESS(20004,"冻结成功"),
    QUERY_SUCCESS(20005,"查询成功"),
    ADD_SUCCESS(20006,"添加成功"),
    LOGIN_SUCCESS(20007,"登陆成功"),
    UPDATE_SUCCESS(20008,"更新成功"),
    COLLECT_SUCCESS(20009,"收藏成功"),
    SUB_SUCCESS(20010,"订阅成功"),
    CANCEL_SUB_SUCCESS(20011,"取消订阅成功"),
    LOGIN_FAILED(30000,"糟糕，登录失败,请检查你的账号或者密码是否存在"),
    PARSE_ERROR(30001,"解析出错"),
    FREEZE_FAILED(30002,"冻结失败"),
    ERROR(30003,"操作失败"),
    USERNAME_OR_PASSWORD_NOT_CORRECT(30004,"请确认你的账号或者密码是否正确"),
    UPDATE_FAILED(30005,"更新失败"),
    COLLECT_FAILED(30006,"收藏失败"),
    SUB_FAILED(30007,"订阅失败"),
    DATA_NOT_FOUND(40001,"查询失败"),
    PARAMS_NULL(40002,"参数不能为空"),
    NOT_LOGIN(40003,"当前账号未登录"),
    NOT_FOUND(40004,"资源不存在"),
    METHOD_NOT_ALLOWED(40005,"请求方法不允许"),
    PARAMS_ERROR(40006,"参数或者数据格式不合法"),
    SQL_UNIKEY_ERROR(40007,"你输入的账号已经被别人注册了！！！"),
    SERVER_INTERVAL_ERROR(50000,"服务器内部错误"),
    NULL_POINTER(50001,"空指针异常"),
    SQL_ERROR(50002,"SQL 语句异常"),
    UPLOAD_FAILED(50003,"上传失败"),
    IO_ERROR(50004,"文件读写出错"),
    ;


    private Integer code;
    private String msg;

    ResultEnums(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
}
